package co.za.alicrity.exactcover;

import java.util.List;


public class testMatrix extends ExactCoverMatrix{

	@Override
	public boolean getAt(int row, int col) {
		if (row==0){
			if (col==0) return true;
			if (col==1) return true;
			if (col==2) return false;
			if (col==3) return false;
			if (col==4) return false;
			if (col==5) return false;
			if (col==6) return false;
		}
		if (row==1){
			if (col==0) return false;
			if (col==1) return false;
			if (col==2) return true;
			if (col==3) return true;
			if (col==4) return false;
			if (col==5) return false;
			if (col==6) return false;
		}
		if (row==2){
			if (col==0) return false;
			if (col==1) return false;
			if (col==2) return false;
			if (col==3) return false;
			if (col==4) return true;
			if (col==5) return true;
			if (col==6) return true;
		}
		if (row==3){
			if (col==0) return true;
			if (col==1) return true;
			if (col==2) return true;
			if (col==3) return false;
			if (col==4) return false;
			if (col==5) return false;
			if (col==6) return false;
		}
		if (row==4){
			if (col==0) return false;
			if (col==1) return false;
			if (col==2) return false;
			if (col==3) return true;
			if (col==4) return true;
			if (col==5) return false;
			if (col==6) return false;
		}
		if (row==5){
			if (col==0) return false;
			if (col==1) return false;
			if (col==2) return false;
			if (col==3) return false;
			if (col==4) return false;
			if (col==5) return true;
			if (col==6) return true;
		}
		
		return false;
	}

	@Override
	public int getRows() {
		// TODO Auto-generated method stub
		return 6;
	}

	@Override
	public int getCols() {
		// TODO Auto-generated method stub
		return 7;
	}
	
	public String toString(){
		String n="";
		for (int r=0;r<getRows();r++){
			for (int k=0;k<getCols();k++){
				n+=(getAt(r, k)?"1":0)+"\t";
			}
			n+="\n";
		}
		return n;
	}
	
	public static void main(String args[]){
		//System.out.println(new ExactCoverSparceMatrix(new testMatrix()).toString());
		
		testMatrix t = new testMatrix();
		
		SolutionList s = new SolutionList(t);
		System.out.println(new testMatrix());
		System.out.println(new ExactCoverSparceMatrix(t).toString());
		System.out.println(new TreeNodes(new ExactCoverSparceMatrix(t),s).toString());
		
		System.out.println(s);
	}

	@Override
	public void applySolution(List<Integer> rowNumbers) {
		// TODO Auto-generated method stub
		
	}

}
